<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>注册</title>

<link rel="stylesheet" type="text/css"
	href="/crowd-sourcing/static/bootstart/css/bootstrap.min.css" />
<style>
body {
	background-image: url(/crowd-sourcing/img/301235.jpg);
	background-size: 100%;
}

.form-horizontal {
	margin-top: 250px;
	margin-left: 250px;
}
.form-control{
width:600px;
}
.checkbox{
	margin-left: 100px;
}
.btn-success{
margin-left: 400px;
}
</style>
</head>

<body>
	<form class="form-horizontal">
		<div class="form-group">
			<label for="inputEmail3" class="col-sm-2 control-label">用户名</label>
			<div class="col-sm-10">
				<input type="email" class="form-control" id="inputEmail3" autocomplete="off"
					placeholder="用户名">
			</div>
		</div>
		<div class="form-group">
			<label for="inputPassword3" class="col-sm-2 control-label">密码</label>
			<div class="col-sm-10">
				<input type="password" class="form-control" id="inputPassword3"
					placeholder="密码">
			</div>
		</div>

		<button type="button" class="btn btn-success"
			onclick="window.location.href='/crowd-sourcing/logou.jsp'">返回登录界面</button>
		<button type="button" class="btn btn-primary" onclick="reg()">注册</button>
	</form>
	<script src="/crowd-sourcing/static/js/jquery-3.4.1.js"></script>
	<script type="text/javascript">
		function reg(){
			var input = $(".form-horizontal input");
			//获取用户输入框的值
			var dept = {
				
				"name":input[0].value,
				"pswd":input[1].value
			}
			$.ajax({
				type:"post",
			    url:"gou",
			    data:{
			    	"opo":"add",
			    	"da" : JSON.stringify(dept)
			    },
			   
			success:function(data){
				
				if (data == "true") {
					alert("注册成功 ");
					
				} else {
					alert("注册失败");
				}
			}
			})
		}
	</script>
</body>
</html>